package com.lanqiao.testwork01;

public class Student {
	private String[] stuNo = { "01", "02", "03" };
	private String[] stuName = { "张三", "李四", "王五" };
	private int[] score = { 80, 60, 95 };

	public Student() {
	}

	public void show() {
		String temp;
		for (int i = 0; i < score.length; i++) {
			for (int j = 0; j < score.length - 1; j++) {
				if (score[j] < score[j + 1]) {
					temp = stuName[j];
					stuName[j] = stuName[j + 1];
					stuName[j + 1] = temp;

					temp = stuNo[j];
					stuNo[j] = stuNo[j + 1];
					stuNo[j + 1] = temp;

					score[j] = score[j] ^ score[j + 1];
					score[j + 1] = score[j] ^ score[j + 1];
					score[j] = score[j] ^ score[j + 1];
				}
			}
		}
		for (int k = 0; k < score.length; k++)
			System.out.println("学号：" + stuNo[k] + "，姓名：" + stuName[k] + "，成绩：" + score[k]);

	}
}